package com.CGFrame.struts.bean.UserLogin;


import com.CGFrame.struts.POJOs.*;
import com.CGFrame.struts.bean.*;

public class LoginValidate {
	
	ProjectOperate pop = ProjectOperateFactory.getprojectOperate();
	public String LoginCheck(String regname,String password)
	{
		MD5 m = new MD5();
		String CipherCode = m.getMD5ofStr(new String(password));
		Reguser r = (Reguser)pop.UniqueQuery("Reguser", "regName,"+regname);
		if(r==null)
		{
			return "NoUser";
		}
		else if(r.getPassWord().equals(CipherCode))
		{
			return r.getRegUserId()+"";

		}
		else
		{
			return "False";
		}
	}
	
	
}